<h3><%=@pcate.name%>类商品列表</h3>
<div class="tab_wapper">
  <% if editor? %>
    <a href="/pcates/<%= @pcate.id.to_s %>/products/new"  class="action_add" style="float:right;">
      添加商品
    </a>
  <% end %>
</div>

<ul class="hot_list" style="margin-bottom: 10px;">
  <% for p in @products %>
    <li>
      <dl class="img_container">
        <dt>
          <% if p.pcolors.length > 0 %>
            <a href="/pcates/<%= p.pcate_id.to_s %>/products/<%= p.id.to_s %>">
              <% pcolor = p.pcolors.first  %>
              <%= image_tag url_for_file_column(pcolor,"image_url","medium"),:title=>"点击查看",:class=>'hot_list_img' if pcolor.image_url %>
            </a>
          <%  end %>
        </dt>
      </dl>
      <dl class="rank_button_container">
        <dt class="detail_toolbar">
          <%=p.name%>
        </dt>
        <dt class="detail_toolbar">
          <span class="yen"><%=p.price%></span>
        </dt>
        <dt class="detail_toolbar">
          <%if editor?%>
            <%= link_to "修改商品信息",[:edit,@pcate,p],:title=>'修改',:class=>'action_edit' %>
            <%= link_to "删除商品",[@pcate,p], :confirm => '确定删除?', :method => :delete,:title=>'删除',:class=>'action_delete' %>
          <%end%>
        </dt>
      </dl>
    </li>
  <% end %>
</ul>
<div id="pager">
  <%= will_paginate @products,:prev_label => '«上一页',:next_label => '下一页»' %>
</div>

<div class="action_link" style="float:left;">
  <%= link_to '返回', back_url,:class=>'action_back' %>
</div>